#include<stdio.h>
#define f(x) x*x*x
int main()
{   int n;
    int a,b,c;
    while(1==scanf("%d",&n)){
        if(n==0)break;
        a=n/100;
        b=(n%100)/10;
        c=n%10;
        if(f(a)+f(b)+f(c)==n)
            puts("Yes");
        else
            puts("No");
    }
    return 0;
}
